package com.atguigu.gmall.feign.product;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.entity.SkuImage;
import com.atguigu.gmall.product.entity.SkuInfo;
import com.atguigu.gmall.product.entity.SpuSaleAttr;
import com.atguigu.gmall.product.vo.CategoryTreeVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author tangsy
 * @Description TODO
 * @date 2022/12/4 11:31
 * @Version 1.0
 */
@RequestMapping("/api/inner/rpc/product")
@FeignClient("service-product")
public interface ProductSkuDetailsFeignClient {

    //1 获取分类视图
    @GetMapping("/category/view/{c3Id}")
    Result<CategoryTreeVo> getCategoryView(@PathVariable("c3Id")Long c3Id);

    //2 获取商品详情
    @GetMapping("skuInfo/{skuId}")
    Result<SkuInfo> getSkuInfo(@PathVariable("skuId") Long skuId);

    //3 获取商品图片
    @GetMapping("/skuimages/{skuId}")
    Result<List<SkuImage>> getSkuImages(@PathVariable("skuId") Long skuId);

    //4 获取销售属性
    @GetMapping("/skusaleattr/{spuId}/{skuId}")
    Result<List<SpuSaleAttr>> getSpuSaleAttr(@PathVariable("spuId") Long spuId, @PathVariable("skuId") Long skuId);

    //5 valuesSkuJson
    @GetMapping("/valuesSkuJson/{spuId}")
    Result<String> getValuesSkuJson(@PathVariable("spuId") Long spuId);
}
